<template>
  <div class="wrapper">
    <p>Original message: "{{ message }}"</p>
    <p>Computed reversed message: "{{ reversedMessage }}"</p>
    <p>Reversed message: "{{ reversedMessage() }}"</p>
  </div>
</template>

<script>
export default {
  name:"ComputedComponent",
  components:{},
  props:{},
  data(){
    return {
      message: 'Hello'
    }
  },
  watch:{},
  computed: {
    now: function () {
      return Date.now()
    }
  },
  // 在组件中
  methods: {
    reversedMessage: function () {
      return this.message.split('').reverse().join('')
    }
  },
  created(){},
  mounted(){}
}
</script>
<style scoped>
.wrapper{}
</style>